
<div class="Breadcrumb">
	  <div class="Breadcrumb-i">您当前所在的位置：<span><a href="<?php echo base_url($this->_site_path.'/admin_group');?>">管理员组管理</a></span>&nbsp;>&nbsp;<span class="orange"><?php echo isset($admin_group_data['group_id'])?'修改':'添加';?></span> </div>               <div class="Breadcrumb-div">
       	   <ul>
           	   <li class="Breadcrumb-tj"><a href="<?php echo base_url( $this->_site_path.'/admin_group/add' );?>" >添加</a></li>
           	   <li class="Breadcrumb-lb"><a href="<?php echo base_url( $this->_site_path.'/admin_group' );?>" >列表</a></li>
           </ul>
        </div>
</div>
<div class="box box-headtitle box-radius">
	<?php if ( $is_edit == TRUE ) {?>
	<h4 class="title">管理员组管理修改</h4>
	<?php } else {?>
	<h4 class="title">管理员组管理添加</h4>
	<?php }?> 

	<?php get_messagebox();// 获取提示框 ?>
	<form method="post">
		
		<div class="control-group">
			<label class="control-label" for="group_name">名称</label>
			<div class="controls">
				<input type="text" name="group_name" id="group_name" placeholder="" value="<?php echo isset($admin_group_data['group_name'] ) ? $admin_group_data['group_name'] : ''; ?>">
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label" for="group_description">描述</label>
			<div class="controls">
				<input type="text" name="group_description" id="group_description" placeholder="" value="<?php echo isset($admin_group_data['group_description'] ) ? $admin_group_data['group_description'] : ''; ?>">
			</div>
		</div>
		<br/>
		<div class="control-group">
			<label class="control-label operations" for="operations">该管理员组拥有的权限 </label>
			<label><input name="checkAll" type="checkbox" onclick="checkOperationsAll()"/>&nbsp;全选</label>
			<br/>
			<?php foreach($this->operations_type_model->get_values('type_id','type_name') as $k => $v){?>
			<?php echo '<br/><hr style="color:green"/>'.$v.'<hr/><br/>';?>
			<div class="per_<?php echo $k;?>">
				<?php echo form_checkbox_list('operations',$this->operations_model->get_values('operation_id','operation_name',array('operations_type_id'=>$k)),$old_operations);?>
			</div>
			<?php }?>
		</div>
		<div class="control-group control-group-submit">
			<?php if ( $is_edit == TRUE ) {?>
				<button type="submit" class="btn  btn-blue btn-left">修改</button>
			<?php } else {?>
				<button type="submit" class="btn  btn-blue btn-left">添加</button>
			<?php }?> 
			<button type="reset" class="btn  btn-blue btn-left">重置</button>
		</div>
		<input type="hidden" name="is_submit" value="1">
		<input type="hidden" name="group_id" id="group_id"  value="<?php echo isset($admin_group_data['group_id'] ) ? $admin_group_data['group_id'] : ''; ?>">
		<!--__TOKEN__-->
	</form>
</div>
<script type="text/javascript">
	function checkOperationsAll(){
		if($("input[name='checkAll']").attr("checked")==='checked'){
			$("input[name='operations[]']").attr('checked','checked');
		}else{
			$("input[name='operations[]']").removeAttr('checked');
		}
	}
</script>